<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
    <link rel="stylesheet" href="../css/weui.css"/>
    <link rel="stylesheet" href="../css/login.css"/>
    <script src="../js/jquery-2.1.1.min.js"></script>
    <script src="../js/main.js"></script>
    <script src="../layer/layer.js"></script>
    <title></title>
</head>
<body>


<div id="d" style="padding-bottom:10%;width:100%;height:0;margin-top: 1rem;background-color: black;margin-top: 0px;">
    <div style="width:70%;margin:auto auto;">
        <img src="../img/index/top.png" style="height: auto;width:100%; margin:auto auto;"/>
    </div>
</div>


<div class="weui-panel weui-panel_access" id="data">


        <!--<div class="weui-cell">-->
            <!--<div class="weui-cell__bd">-->
                <!--<div class="weui-cell__bd">-->
                    <!--<h4 class="weui-media-box__title">成果1</h4>-->
                    <!--<p class="weui-media-box__desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>-->
                <!--</div>-->
            <!--</div>-->
            <!--<div class="weui-cell__ft weui-swiped-btn weui-swiped-btn_default" onclick="delService(2)">删除</div>-->
        <!--</div>-->

    </div>

<script>
    $.ajaxSetup({
        xhrFields: {
            withCredentials: isCrossDomain
        }
    });
    $(function () {
        $.get(mainurl+"skill/getResultList",function (data) {
            if(checkData(data)){
                var dat = data.data;
                for(var i=0; i<dat.length; i++) {
                    var d = dat[i];
                    var rid = d.rid;
                    var title = d.title;
                    var content = d.content;
                    $("#data").append("<div class=\"weui-cell\">\n" +
                        "            <div class=\"weui-cell__bd\">\n" +
                        "                <div class=\"weui-cell__bd\">\n" +
                        "                    <h4 class=\"weui-media-box__title\">"+title+"</h4>\n" +
                        "                    <p class=\"weui-media-box__desc\">"+content+"</p>\n" +
                        "                </div>\n" +
                        "            </div>\n" +
                        "            <div class=\"weui-cell__ft weui-swiped-btn weui-swiped-btn_default\" onclick=\"delService("+rid+")\">删除</div>\n" +
                        "        </div>");
                }

            }
        })
    });
    function delService(i,o) {
        layer.confirm('是否确认删除？', {
            btn: ['是的','取消'] //按钮
        }, function(){//y
            $.post(mainurl+"skill/delResult",{rid:i},function (data) {
                if(checkData(data)) {
                    $("div[onclick='delService("+i+")']").parents('.weui-cell').remove();
                    successInfo("删除成功");
                }
            });
            layer.closeAll();
        }, function(){

        });
    }
</script>
</body>
</html>
